<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app"></div>
    <template id="t1">
      <div>
        <h2 v-if="date==='1-1'">元旦</h2>
        <h2 v-else-if="date==='5-1'">五一</h2>
        <h2 v-else-if="date==='6-1'">六一</h2>
        <h2 v-else-if="date==='10-1'">国庆</h2>
        <h2 v-else>...</h2>
      </div>
    </template>
    <script src="./vue.js"></script>
    <script>
      // 数据驱动视图
      const vm = new Vue({
        el: "#app",
        template: "#t1",
        data: {
          date: "5-1",
        },
        created() {
          setInterval(() => {
            this.num++;
          }, 1000);
        },
      });
    </script>
  </body>
</html>
